package com.ojoin.trade.common.web.service;

import java.util.List;

import org.springframework.data.domain.Pageable;

import com.ojoin.trade.common.web.domain.Area;
import com.ojoin.trade.common.web.domain.Button;
import com.ojoin.trade.common.web.domain.Dict;
import com.ojoin.trade.common.web.domain.Menu;
import com.ojoin.trade.common.web.domain.Office;
import com.ojoin.trade.common.web.domain.Role;
import com.ojoin.trade.common.web.domain.User;
import com.ojoin.trade.common.web.ldap.LdapSettings;
import com.ojoin.trade.common.web.ldap.support.LdapEntry;

public interface SysManageService {
	 
	public User getUser();
	 
	public User get(Integer id);

	public User getFromDB(Integer id);

	public User getByLoginName(String loginName);

	public List<User> findUser(User user);
	
	public List<User> findUser(User user,Pageable page);

	public List<User> findUserByOfficeId(Integer officeId);

	public  void clearCache();
	
	public void saveUser(User user);

	public void updateUserInfo(User user);

	public void deleteUser(User user);

	public void updatePasswordById(Integer id, String loginName,
			String newPassword);

	public void updateUserLoginInfo(User user);
	 
	public List<Role> getRoleList();

	public List<Office> getOfficeList();
	 
	public List<Area> getAreaList();
	
	public List<Button> getButtonList();
	
	public List<Menu> getMenuList();

	public Menu getMenu(Integer id) ;
	
	public Button getButton(Integer id) ;

	public List<Menu> findAllMenu();
	
	public List<Object> findAllMenuAndButton();
	
	public List<Button> findAllButton();
	
	public void saveMenu(Menu menu) ;
	
	public void saveButton(Button button) ;

	public void updateMenuSort(Menu menu);

	public void deleteMenu(Menu menu);
	
	public void deleteButton(Button button);

	public Role getRole(Integer id);

	public Role getRoleByName(String name);

	public Role getRoleByEnname(String enname);

	public List<Role> findRole(Role role);

	public void saveRole(Role role);

	public void deleteRole(Role role);

	public Boolean outUserInRole(Role role, User user);

	public User assignUserToRole(Role role, User user);
	
	public  String getDictLabel(String value, String type, String defaultValue);
	
	public  String getDictLabels(String values, String type, String defaultValue);

	public  String getDictValue(String label, String type, String defaultLabel);
	
	public  List<Dict> getDictList(String type);
	
	public User syncFromLdapEntry(LdapEntry userEntry, LdapSettings ldapSettings, String username);
}
